package com.syh.jn.scm.service.api.upstream.logistics.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Created by soci.song on 2018/10/18.
 */
@Getter
@AllArgsConstructor
public enum UpLogisticsBillEnum {

  //物流状态
  DRIVER_UNDELIVERY(Short.valueOf("0"), "未发车", "物流状态"),
  DRIVER_DELIVEED(Short.valueOf("1"), "已发车", "物流状态"),
  DRIVER_SIGNIN(Short.valueOf("2"), "已收货", "物流状态"),

  ORDER_TYPE_SALE(Short.valueOf("2"), "销售单", "订单类型"),
  ORDER_TYPE_RETURN_SALE(Short.valueOf("3"), "销售退货单", "订单类型"),

  // 物流类型
  LOGISTICS_TYPE_CAR(Short.valueOf("1"), "陆运", "物流类型"),
  LOGISTICS_TYPE_FLIGHT(Short.valueOf("2"), "空运", "物流类型"),
  LOGISTICS_TYPE_SHIPPING(Short.valueOf("3"), "海运", "物流类型"),
  // 往来单位类型
  CUSTOMER_TYPE_UPSTREAM(Short.valueOf("0"), "上游", "往来单位类型"),
  CUSTOMER_TYPE_DOWNSTREAM(Short.valueOf("1"), "下游", "往来单位类型"),
  CUSTOMER_TYPE_LOGISTICS(Short.valueOf("2"), "物流", "往来单位类型");

  private Short status;
  private String statusName;
  private String statusBelong;

  //发货类型
  @Getter
  @AllArgsConstructor
  public enum DeliveryType {
    LOGISTICS_TYPE(Short.valueOf("1"), "物流发货", "发货类型"),
    TRACKING_TYPE(Short.valueOf("2"), "快递发货", "发货类型"),
    OTHER_TYPE(Short.valueOf("3"), "其它发货", "发货类型");

    private Short deliveryType;
    private String deliveryName;
    private String deliveryBelong;

    @Override
    public String toString() {
      return this.deliveryType.toString();
    }

    public static UpLogisticsBillEnum.DeliveryType valueOf(Short deliveryType) {
      switch (deliveryType) {
        case 1:
          return LOGISTICS_TYPE;
        case 2:
          return TRACKING_TYPE;
        case 3:
          return OTHER_TYPE;
      }
      return null;
    }
  }

}
